<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            var jsonObj = {ename: "张淑娜", birthDate: "2024-11-01"}
            var jsonStr = JSON.stringify(jsonObj)
            $.ajax({
                url: "demo1.action",
                // data: "ename=zhangsan&birthDate=2024-11-01",
                // data: {ename: "张淑娜",birthDate: "2024-11-01"},
                // data: '{"ename": "张淑娜","birthDate": "2024-11-01"}',
                data: jsonStr,
                contentType: "application/json",
                // type: "get",
                type: "post",
                success: function (result) {
                    console.log(result)
                }
            })
        })
    </script>
</head>
<body>

</body>
</html>
